import request from "@/utils/request.js"

export const login = (data : any) => {
	return request({
		path: 'user/login',
		data,
		method: "POST"
	})
}

// 首页轮播
export const indexSwiper = () => {
	return request({
		path: "index/carousel"
	})
}

// 首页商品
export const indexShop = (data : any) => {
	return request({
		path: 'index/shop',
		data,
	})
}

// 用户信息获取
export const myUserInfo = () => {
	return request({
		path: "user/userinfo",
	})
}

// 用户信息设置
export const mySetUserInfo = (data : any) => {
	return request({
		path: "user/profile",
		method: "POST",
		data
	})
}

// 收藏列表
export const collectionList = (data : any) => {
	return request({
		path: "goods/collectionList",
		method: "POST",
		data
	})
}

// 收藏添加取消
export const collection = (data : any) => {
	return request({
		path: "goods/collection",
		method: "POST",
		data
	})
}

// 订单列表
export const orderList = (data : any) => {
	return request({
		path: "order/list",
	})
}
// 商家入驻接口
export const settled = (data : any) => {
	return request({
		path: "shop/settled",
		method: "POST",
		data
	})
}
// 商家接口
export const shopInfo = (data : any) => {
	return request({
		path: "shop/shopInfo",
		data
	})
}
// 代理申请
export const agent = (data : any) => {
	return request({
		path: "shop/agent",
		method: "POST",
		data
	})
}

// 代理查询
export const getAgent = (data : any) => {
	return request({
		path: "shop/getAgent",
		data
	})
}

// 商品详情接口
export const goodsDetail = (data : any) => {
	return request({
		path: "goods/detail",
		data
	})
}
// 收货地址列表
export const addressList = (data : any) => {
	return request({
		path: "user/addressList",
		method: "POST",
		data
	})
}
// 添加收货地址
export const addAddress = (data : any) => {
	return request({
		path: "user/addAddress",
		method: "POST",
		data
	})
}
// 修改默认收货地址
export const addressDefault = (data : any) => {
	return request({
		path: "user/addressDefault",
		method: "POST",
		data
	})
}
// 修改地址
export const editAddress = (data : any) => {
	return request({
		path: "user/editAddress",
		method: "POST",
		data
	})
}

// 获取行业
export const getIndustry = () => {
	return request({
		path: "index/industry",
	})
}

// 获取城市
export const getCity = (data : any) => {
	return request({
		path: "index/city",
		data
	})
}

// 提交订单
export const orderCreate = (data : any) => {
	return request({
		path: "order/create",
		method: "POST",
		data
	})
}

